/*
 *
 *  ------------------------------------------------------------------
 *  Copyright © 2017 Hangzhou DtDream Technology Co.,Lt d. All rights reserved.
 *  ------------------------------------------------------------------
 *        Product:  EMR
 *    Module Name: NEZHA
 *   Date Created: 17-10-23 下午4:22
 *    Description:
 *  ------------------------------------------------------------------
 *  Modification History
 *  DATE            Name           Description
 *  ------------------------------------------------------------------
 *  2017-10-23      NEZHA EMR
 *  ------------------------------------------------------------------
 * /
 */

package org.xukai.remoting.sdk.web;

import com.dtdream.emr.common.model.AccessKey;
import com.dtdream.emr.sql.pojo.SQLResult;

import java.sql.SQLException;

/**
 * Created by moriarty on 16-10-13.
 */
public class Example {
    public static void main(String[] args) {
        String project = "default";
        AccessKey accessKey = new AccessKey("hdfs", "hdfs");
        String nezhaUrl = "http://localhost:9997";

        // Execute SQL
        SQLClientManager sqlClientManager = new SQLClientManager(nezhaUrl);
        try {
            SQLClient sqlClient = sqlClientManager.newSQLClient(accessKey, project);
            SQLResult result = sqlClient.executeQuery("select 1");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
